const http = require("http");
const _ = require("lodash");//lodash使用全局的_来提供对工具的快速访问
const [host, port] = ['localhost', 9999];
let url = "";
http.createServer((req, res) =>{
    res.writeHead(200, {
        "Content-Type" : "text/plain"
    });
    res.end("Hello Node.js","utf-8");
}).listen(port);

url = _.isEmpty(port) ? `http://${host}:${port}`:'';
console.log(`Our awesome web server is running at ${url}`);
